home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4669 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: void main() and other atrocities!
  5. Date: 6 Feb 1996 13:25:56 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4f7kt4$ltb@sparcserver.lrz-muenchen.de>
  9. References: <4eduaj$1aq@grouper.Exis.Net> <4em17r$shq@jaxnet.jaxnet.com> <4emub9$1mo@fountain.mindlink.net> <4epplj$egf@host-3.cyberhighway.net> <4erjn2INN38b@keats.ugrad.cs.ubc.ca> <9602021300.AA04359@dxmint.cern.ch> <4f5vc2$qcj@cdn_news.telecom.com.au>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. jolson@vprpmel1.telecom.com.au (Jeff Olson) writes:
  13.  
  14. >How about:
  15.  
  16. >int main (int argc, char **argv)
  17.  
  18. >I saw in the FAQ that a multi-dimentional array will not decay into a pointer 
  19. >to a pointer.
  20.  
  21. This is true in the sense that an array of arrays will decay to a pointer
  22. to the first element, which happens to be an array. There is no special
  23. rule for arrays of arrays.
  24.  
  25. >This main() is valid with my Sparcworks compiler so I would 
  26. >like to know if my compiler is supporting non-standard behavior
  27.  
  28. Yes, it is, but not in this case.
  29.  
  30. >or if argv is 
  31. >a pointer to an array of characters (meaning it can decay into a pointer to a 
  32. >pointer).
  33.  
  34. "argv" may well be an array of pointers to char, and you cannot tell
  35. the difference, but a pointer to an array will _not_ decay to a
  36. pointer to a pointer.
  37.  
  38. Kurt
  39. --
  40. | Kurt Watzka                             Phone : +49-89-2180-6254
  41. | watzka@stat.uni-muenchen.de
  42. | ua302aa@sunmail.lrz-muenchen.de
  43.